/*
 * @FilePath: main.js
 * @Author: 杜芬
 * @Date: 2024-04-15 22:15:45
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-04-16 20:35:26
 * Copyright: 2024 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 页面
 */
import { scene, camera } from './utils/init'
import * as THREE from 'three'

function createFloor() {
  // 1. 创建平面缓冲几何
  const geometry = new THREE.PlaneGeometry(10, 10)

  // 材质
   const material = new THREE.MeshBasicMaterial({
     color: 0xffffff // 材质设置颜色为白色
   })

  //  创建物体
  const plane = new THREE.Mesh(geometry, material)
  // plane.rotation.set( - Math.PI / 2, 0, 0)
  plane.rotation.set( - Math.PI / 2, 0, 0)
  // 加入到场景中
  scene.add(plane)
}


// 2.环境光
function createLight() {
  // 环境光 创建完加入到场景中
  const light = new THREE.AmbientLight(0xffffff, 1)

  scene.add(light)

}


camera.position.set(5, 5, 5) // 设置摄像机的位置
createFloor()
createLight()